// Button 基本样式
.btn {
  position: relative;
  display: inline-block;
  font-weight: $btn-font-weight; // 400
  line-height: $btn-line-height; // 1.5
  color: $body-color; // #212529
  white-space: nowrap; // 不换行
  text-align: center;
  vertical-align: middle;
  background-image: none;
  border: $btn-border-width solid transparent; // 1px

  // 使用 mixin 复用样式
  // 因为 大、中、小 按钮都有自己对应的样式
  @include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $border-radius);
  // padding: $btn-padding-y $btn-padding-x; // 0.375rem 0.75rem
  // font-size: $btn-font-size; // 1rem
  // border-radius: $border-radius; // 0.25rem
  box-shadow: $btn-box-shadow; // inset 0 1px 0 rgba($white, 0.15), 0 1px 1px rgba($black, 0.075)
  cursor: pointer;
  transition: $btn-transition;
  &.disabled,
  &[disabled] {
    cursor: not-allowed;
    opacity: $btn-disabled-opacity;
    box-shadow: none;
    > * {
      pointer-events: none;
    }
  }
}

// 定义不同规格按钮
.btn-lg {
  @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-border-radius-lg);
}
.btn-sm {
  @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-border-radius-sm);
}
// 定义不同样式按钮
.btn-primary {
  @include button-style($primary, $primary, $white);
}
.btn-danger {
  @include button-style($danger, $danger, $white);
}
.btn-default {
  @include button-style($white, $gray-400, $body-color, $white, $primary, $primary);
}
// 定义特殊的Link Button
.btn-link {
  font-weight: $font-weight-normal;
  color: $btn-link-color; // primary color
  text-decoration: $link-decoration;
  box-shadow: none;
  &:hover {
    color: $btn-link-hover-color;
    text-decoration: $link-hover-decoration;
  }
  &:focus,
  &.focus {
    text-decoration: $link-hover-decoration;
    box-shadow: none;
  }
  &:disabled,
  &.disabled {
    color: $btn-link-disabled-color;
    pointer-events: none;
  }
}
